// 入库单明细 ods_raw_order_in.kd_order_no = ods_appointment.document_no
import React, {Component} from 'react'
import {ListComponent} from '../../../components'
import { Modal } from 'antd';

export default class DownListPage extends React.Component {
    constructor(props) {
        super(props);
        this.state = {

        };
        //行操作列表
        this.rowOperation = [
            {
                handleName: 'rowClick',
                showName: '行单击选择事件'
            }
        ];
        //header 操作列表
        this.headerOperation = [
        ];
        //table列表展示列配置
        //showName、columnName 必有属性， columnWidth 可选，默认100, columnHidden: true 列隐藏（用于列配置显示隐藏）, foreverHidden: true 列永久隐藏
        this.tableColumn = {
            data: [
                {
                    showName: 'ruleDetalId',
                    columnName: 'ruleDetalId',
                    columnHidden:true,
                    foreverHidden: true
                },{
                    showName: '固定值',
                    columnName: 'ruleCode'
                },{
                    showName: '起始位置',
                    columnName: 'beginLoc'
                },{
                    showName: '结束位置',
                    columnName: 'endLoc'
                },{
                    showName: '填充内容',
                    columnName: 'content'
                },{
                    showName: '必含字段',
                    columnName: 'includeContent'
                },{
                    showName: '不包含值',
                    columnName: 'excludeContent'
                },{
                    showName: '字段类型',
                    name:'contentType',
                    type: 'select',
                    url: null,
                    optionList:[
                        {
                            optionKey:'',
                            optionShow:''
                        },{
                            optionKey:'0',
                            optionShow:'日期'
                        },{
                            optionKey:'1',
                            optionShow:'流水'
                        }
                    ]
                }
            ]
        };
    }
    rowHandles = (strHandles, rowObj) => {
        if(strHandles == 'rowClick'){
            this.rowClickHandle(rowObj);
        }
    }

    rowClickHandle = (rowObj) => {
        console.log("单行选择rowObj===", JSON.stringify(rowObj));
    }
    refreshHandle = () => {
        this.refs.listComponent.refreshHandle();
    }


    render() {
        return (
            <div>
                <ListComponent
                    ref = "listComponent"
                    url = '/base/data/serialrule/listDetail'
                    searchCondition={this.props.searchCondition}
                    tableColumnData = {this.tableColumn}
                    headerOperation = {this.headerOperation}
                    rowOperation = {this.rowOperation}
                    rowHandles = {this.rowHandles}
                    isRowSingle = "true"
                    subtractHeight = '100'
                    subtractWidth ='20'
                />
            </div>
        );
    }
}
